<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:jsd="http://www.cycle99.com/tools/ecmadoc"
	xmlns:math="http://www.cycle99.com/tools/ecmadoc/transform/math"
	xmlns:help="http://www.cycle99.com/tools/ecmadoc/transform/help"
	xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="jsd math help">

	<xsl:output method="xml" indent="yes" encoding="utf-8" omit-xml-declaration="yes"
		doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>

	<xsl:template match="*">
		<xsl:apply-templates select="/"/>
	</xsl:template>

	<xsl:template match="/">
		<html lang="en" id="{$transformName}">
			<head>
				<xsl:apply-templates select="." mode="head"/>
				<xsl:apply-templates select="." mode="head-current"/>
			</head>
			<xsl:apply-templates select="." mode="body"/>
		</html>
	</xsl:template>

	<xsl:template match="/" mode="head">
		<title>
			<xsl:apply-templates select="." mode="title"/>
		</title>
		<link type="text/css" rel="stylesheet" href="css/{$themeName}.css"/>
		<script type="text/javascript" language="javascript" src="scripts/aeon.js"></script>
	</xsl:template>

	<xsl:template match="/" mode="head-current">
	</xsl:template>

	<xsl:template match="/" mode="title">
		<xsl:variable name="title-page">
			<xsl:apply-templates select="." mode="title-page"/>
		</xsl:variable>
		<xsl:variable name="title-project">
			<xsl:apply-templates select="." mode="title-project"/>
		</xsl:variable>
		<xsl:value-of select="$title-page"/>
		<xsl:if test="string-length($title-page) != 0">
			<xsl:text> - </xsl:text>
		</xsl:if>
		<xsl:value-of select="$title-project"/>
	</xsl:template>

	<xsl:template match="/" mode="title-project">
		<xsl:value-of select="/project/@name"/>
	</xsl:template>

	<xsl:template match="/" mode="title-page">
		<xsl:apply-templates select="$transformSubject" mode="item-name"/>
	</xsl:template>

	<xsl:template match="/" mode="body">
		<body>
			<xsl:apply-templates select="." mode="properties"/>
			<xsl:apply-templates select="." mode="layout"/>
		</body>
	</xsl:template>

	<xsl:template match="/" mode="properties">
		<xsl:attribute name="class">
			<xsl:if test="$showPrivates = 1">
				<xsl:text>showPrivates </xsl:text>
			</xsl:if>
		</xsl:attribute>
	</xsl:template>
	
	<xsl:template match="/" mode="layout">
		<xsl:apply-templates select="." mode="layout-default"/>
	</xsl:template>

	<xsl:template match="/" mode="layout-default">
		<xsl:apply-templates select="." mode="content"/>
	</xsl:template>

	<xsl:template match="/" mode="content">
		DEFAULT OUT
	</xsl:template>

</xsl:stylesheet>
